import java.io.*;

public class fileinputstreamDemo3 {
    public static void main(String[] args) throws IOException {
        System.out.println("============");
        File file = new File("F:\\000java_document\\02Java-next\\fileInputStreamDemo1\\src\\main\\java\\test1.txt");
        InputStream is = new FileInputStream(file);

        byte[] buffer = new byte[(int) file.length()];
        int len = is.read(buffer);
        System.out.println("读取了多少个字节: " + len);
        System.out.println("文件大小: "+ file.length());
        System.out.println(new String(buffer));



    }
}
